<template>
  <div></div>
</template>

<script>
export default {
  components: {},
  props: ["source"],
  data() {
    return {};
  },
  // 计算属性 只有依赖数据发生改变，才会重新进行计算
  computed: {},
  // 计算属性 数据变，直接会触发相应的操作
  watch: {},
  methods: {
    toast(title, info, variant) {
      let config = {
        title: title,
        toaster: "b-toaster-top-center",
        variant: variant,
        autoHideDelay: 3000,
        appendToast: true,
      };
      this.$bvToast.toast(info, config);
    },
  },
  // 在实例创建完成后被立即调用
  created() {
    this.tool.info = (info) => {
      this.$message({ message: info, type: "info", showClose: true });
    };

    this.tool.success = (success) => {
      this.$message({ message: success, type: "success", showClose: true });
    };

    this.tool.warn = (warn) => {
      this.$message({ message: warn, type: "warning", showClose: true });
    };

    this.tool.error = (error) => {
      this.$message({ message: error, type: "error", showClose: true });
    };
  },
  // el 被新创建的 vm.$el 替换，并挂载到实例上去之后调用
  mounted() {
  },
};
</script>

<style>
</style>
